package de.java.hsrm.factory;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.*;

@SuppressWarnings("serial")
public class TestMenuItem extends JMenuItem{

	public TestMenuItem(String text) {
		super(text);
		setOpaque(false);
		setForeground(Color.LIGHT_GRAY);
		initialize();
		build();
		this.setRolloverEnabled(false);
	}

	private void initialize() {
		// TODO initialisiere Felder

		initActionButtons();

	}

	private void build() {
		// TODO implementiere Class
	}

	private void initActionButtons() {
		// TODO implementiere Actionbuttons
	}
	
	@Override protected void paintComponent(Graphics g){
		Graphics2D g2 = (Graphics2D) g;
		
		GradientPaint p = new GradientPaint(0,0,new Color(0x555555),
				0,10,new Color(0x333333));
		g2.setPaint(p);
		g2.fillRect(0, 0, getWidth(), getHeight()/2);
		
		p = new GradientPaint(0,10,new Color(0x222222),
				0,20,new Color(0x111111));
		g2.setPaint(p);
		g2.fillRect(0, getHeight()/2, getWidth(), getHeight()/2);
		
		super.paintComponent(g);
	}
}

